package parser;

import args.Args;
import args.DirArgs;

/**
 * @author leo
 * @date 2021/6/21
 */
public class DirectoryParser{
    private static final String DIRECTORY_FLAG = "-d";
    private static final String DEFAULT_VALUE = "";

    public Args parse(String args) {
        if (args.contains(DIRECTORY_FLAG)){
            String directory = args.split(" ")[4];
            return new DirArgs(DIRECTORY_FLAG,directory);
        }
        return new DirArgs(DIRECTORY_FLAG,DEFAULT_VALUE);
    }
}
